Skip to content

feat: migrate TooltipModal to design system components#27753

Merged
GeorgeGkas merged 4 commits into
mainfrom
swaps-4249
Mar 23, 2026
Merged

feat: migrate TooltipModal to design system components#27753
GeorgeGkas merged 4 commits into
mainfrom
swaps-4249

Conversation

@GeorgeGkas
Copy link
Copy Markdown
Contributor

@GeorgeGkas GeorgeGkas commented Mar 20, 2026

Description

TooltipModal was using legacy component-library patterns (StyleSheet.create, raw View, deprecated BottomSheetFooter, and component-library Text) that are no longer consistent with the current UI development standards.

This PR migrates TooltipModal to fully conform to the new standards:

  • Replaces View with Box from @metamask/design-system-react-native
  • Replaces component-library Text/TextVariant/TextColor with the design system equivalents (TextVariant.BodyMd, TextColor.TextAlternative)
  • Replaces the deprecated component-library BottomSheetFooter (which used a broken Object.assign + StyleSheet.create approach for style overrides) with the design system BottomSheetFooter, which applies styles via a style array and twClassName correctly
  • Removes StyleSheet.create and the companion ToolTipModal.styles.ts file
  • Adds useSafeAreaInsets for device-aware bottom padding on the footer
  • Adds useTailwind for all Tailwind-based styling
  • Updates tests to match the new component structure

The deprecated BottomSheetFooter had a bug where passing paddingHorizontal via its style prop did not apply correctly — the internal Object.assign + StyleSheet.create merge caused the shorthand paddingHorizontal to be overridden by already-resolved longhand values. The design system component resolves this by applying styles as a proper array where the last entry wins.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/SWAPS-4249

Manual testing steps

Feature: TooltipModal rendering and interaction

  Background:
    Given I am logged into MetaMask Mobile

  Scenario: user opens a tooltip and reads content
    Given I am on a screen that displays a tooltip icon (e.g. Swaps confirmation — Slippage row)

    When user taps the info icon next to a label
    Then a bottom sheet should appear with the correct title in the header
    And the tooltip content text should be visible below the header
    And the "Got it" button should be visible in the footer with 16px horizontal padding
    And on devices with a home indicator (iPhone X+) the button should sit above the home bar

  Scenario: user dismisses tooltip via "Got it" button
    Given the tooltip bottom sheet is open

    When user taps the "Got it" button
    Then the bottom sheet should close

  Scenario: user dismisses tooltip via close icon
    Given the tooltip bottom sheet is open

    When user taps the X icon in the header
    Then the bottom sheet should close

  Scenario: tooltip with optional footer text
    Given a tooltip is configured with additional footer text

    When user opens the tooltip
    Then the footer text should appear below the "Got it" button
    And the footer text should respect the safe area bottom inset

Screenshots/Recordings

Before

N/A

After

εικόνα

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Moderate risk because it changes TooltipModal’s component implementation and removes the bottomPadding navigation/typing option, which could affect any callers relying on that param or footer spacing behavior.

Overview
Migrates TooltipModal to the MetaMask design system by replacing legacy View/StyleSheet styling and the deprecated component-library footer with Box, design-system Text, and design-system BottomSheetFooter using Tailwind (useTailwind).

Updates footer spacing to use useSafeAreaInsets for bottom padding and removes the custom bottomPadding route param/options plumbing end-to-end (ToolTipModal.types.ts, useTooltipModal, KeyValueRow tooltip types/usage, and related tests), deleting ToolTipModal.styles.ts and adjusting snapshots/mocks accordingly.

Written by Cursor Bugbot for commit 66dbdb8. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Mar 20, 2026
@github-actions github-actions Bot added size-M risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/Views/TooltipModal/index.tsx
Comment thread app/components/Views/TooltipModal/index.tsx
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 20, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 23, 2026
@GeorgeGkas GeorgeGkas requested review from a team as code owners March 23, 2026 11:58
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Mar 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations, SmokeTrade, SmokePerps, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes refactor the TooltipModal component and its associated hook/types:

  1. TooltipModal UI refactor: Switched from custom StyleSheet to design-system components (Box, Text from @metamask/design-system-react-native) and Tailwind styling. Removed bottomPadding parameter, now uses useSafeAreaInsets for proper safe area handling.

  2. Removed bottomPadding option: Removed from useTooltipModal hook, TooltipModalRouteParams, and KeyValueRowTooltip interface.

  3. KeyValueLabel.tsx: Updated to call openTooltipModal without the removed bottomPadding option.

Affected areas:

  • SmokeConfirmations: The info-row component in confirmations imports TooltipModal. The RewardsCard (staking confirmation) uses useTooltipModal via KeyValueLabel. Staking deposit confirmations show tooltips for reward rate and reward frequency.
  • SmokeTrade: Bridge's QuoteDetailsCard uses KeyValueLabel which uses the tooltip system. Bridge quote details show tooltips for various fee/rate fields.
  • SmokePerps: PerpsOrderView directly uses useTooltipModal for showing tooltips in the perps order flow.
  • SmokeWalletPlatform: Required by SmokePerps per tag dependency rules.

The changes are primarily cosmetic/styling refactors with no functional logic changes, but the tooltip display in these flows should be validated to ensure the safe area insets work correctly on both iOS and Android, and that the design system components render properly.

Performance Test Selection:
The changes are UI refactoring of the TooltipModal component - switching from custom StyleSheet to design system components and Tailwind. This is a modal/overlay component that appears on user interaction, not a core rendering path that would impact measurable performance metrics like app launch, account list rendering, or asset loading. No performance tests are warranted.

View GitHub Actions results

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

@GeorgeGkas GeorgeGkas added this pull request to the merge queue Mar 23, 2026
Merged via the queue into main with commit 12a39a6 Mar 23, 2026
180 of 182 checks passed
@GeorgeGkas GeorgeGkas deleted the swaps-4249 branch March 23, 2026 16:08
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
@metamaskbot metamaskbot added the release-7.72.0 Issue or pull request that will be included in release 7.72.0 label Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants